$( document ).ready(function() {
});

var idConcept;

function loadConceptMaps(idConceptMaps) {
	idConcept = idConceptMaps;
	$.getJSON("listconceptmap/" + idConceptMaps + ".json",{ajax : 'true'},
	function(data) {
		var length = data.length;
		$("#table-user > tbody").html("");
		for (var i = 0; i < length; i++) {
			var content = "<tr>";
			content += "<td>" + (i+1) + "</td>";
			content += "<td>" + data[i].fullName + "</td>";
			content += "<td>" + data[i].idUser	+ "</td>";
			content += "<td>"
					+ "<button type='button' class='btn btn-primary btn-sm'"
					+	 "	resources-toggle='modal' resources-target='#modal_delete_sharemember'>Delete</button>"
					+ "</td>";
			content += "</tr>";
			$("#table-user > tbody").append(content);
		}
	})
}

function share() {
	var idmember = $('#idmember').val();
	$.getJSON("share/" + idConcept + "/" + idmember + ".json",{ajax : 'true'},
	function(data) {
		alert("Success!");
		loadConceptMaps(idConcept);
	})
}
